//用于显示测试需求审核详情的表单
var testRequirementCheckForm = Ext.create("Ext.form.Panel", {
    id: 'testRequirementCheckForm',
    title: '查看详情',
//    header: {
//        height: 20,
//        padding: '1 1 1 1'
//    },
    bodyPadding: 10,
    scrollable: true,
    // titlePosition: 2,//设置工具栏的按钮在标题的左边
    // tools: [{
    //     type: 'prev',
    //     tooltip: '返回上一页',
    //     handler: function () {
    //     	Ext.getCmp('centerRegion').removeAll(false);
    //         Ext.getCmp('centerRegion').add(testCheckGrid);
    //     }
    // }],
    defaults: {
        anchor: '100%',
        layout: 'column', //默认定义组件内部元素为布局为列布局方式
        border: false,
        margin: '20 0 0 0'
    },
    items: [{
        margin: '0 0 0 0',
        defaults: {
            border: false,
            layout: 'form'
        },
        items: [{
            columnWidth: 1, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                labelWidth: 50,
                fieldLabel: '名称',
                itemId: 'testRequirementCheckFormName'
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form'
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                fieldLabel: '审核结果',
                xtype: 'radiogroup',
                itemId: 'testRequirementCheckFormIsPass',
                items: [{boxLabel: '通过', name: 'isPass', inputValue: 1}, {
                    boxLabel: '不通过',
                    checked: true,
                    name: 'isPass',
                    inputValue: 0
                }]
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'displayfield',
                labelWidth: 30,
                fieldLabel: '审核时间',
                itemId: 'testRequirementCheckFormCheckDate'
            }]
        }]
    }, {
        xtype: 'textareafield',
        fieldLabel: '批注',
        labelWidth: 35,
        allowBlank: false,
        itemId: 'testRequirementCheckFormAnnotate'
    }, {
        layout: 'fit',
        height: 350,
        scrollable: true,
        frame: true,//里面如果用htmlEditor的话不知道为什么会报错
        items: [{
            fieldLabel: '审核内容:',
            xtype: 'displayfield',
            itemId: 'testRequirementCheckFormDescribe'
        }]
    }
//    {
//        xtype: 'displayfield',
//        value: '审核内容:'
//    }, {
//        xtype: 'displayfield',
//        itemId: 'testRequirementCheckFormDescribe',
//        minHeight:290 ,
////        listeners:{
////        	render:function(edit, eOpts){
////        		edit.getToolbar().hide();
////        		edit.setReadOnly(true);
////        	}
////        }
//    }
    ],
    buttons: [{
        itemId: 'backButton',
        text: '返回',
        tooltip: '返回',
        listeners: [{
            click: function () {
                Ext.getCmp('centerRegion').removeAll(false);
                Ext.getCmp('centerRegion').add(testCheckGrid);
            }
        }]
    }, {
        text: '保存并提交',
        itemId: 'testRequirementCheckFormSaveAndCommitBtn',
        listeners: [{
            click: function () {
                if (testRequirementCheckForm.isValid()) //判断各种信息填写完整没有
                    saveTestCheckAnnnotateAndIsPass();
                else
                    Ext.Msg.alert('错误', '信息请填写完全！');
            }
        }]
    }]
});

//审核时用于查看测试计划详细信息的表单
var testDesignCheckDetailForm = Ext.create("Ext.form.Panel", {
    header: false,
    bodyPadding: 10,
    border: false,
    defaults: {
        anchor: '100%',
        layout: 'column', //默认定义组件内部元素为布局为列布局方式
        border: false,
        margin: '20 0 0 0'
    },
    items: [{
        margin: '0 0 0 0',
        defaults: {
            border: false,
            layout: 'form',
        },
        items: [{
            columnWidth: 1, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'textfield',
                labelWidth: 50,
                allowBlank: false,
                fieldLabel: '标题',
                name: 'title',
                itemId: 'testDesignDetailFormTitle',
                readOnly: true
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form',
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                labelWidth: 50,
                fieldLabel: '编写者',
                itemId: 'testDesignDetailFormAuthor'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'combo',
                fieldLabel: '优先级',
                allowBlank: false,
                labelWidth: 50,
                editable: false,//防止用户直接在下拉框里输入
                itemId: 'testDesignDetailFormPriority',
                emptyText: '选择计划优先级',
                store: priorityStore,
                queryMode: 'local',
                displayField: 'priorityName',
                valueField: 'priorityNum',
                readOnly: true
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form',
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                fieldLabel: '创建时间:',
                //formatText:'date("Y-m-d H:i:s")',
                labelWidth: 70,
                itemId: 'testDesignDetailFormCreateDate'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'displayfield',
                fieldLabel: '最近更新:',
                //formatText:'date("Y-m-d H:i:s")',
                labelWidth: 70,
                itemId: 'testDesignDetailFormUpdateDate'
            }]
        }]
    }, {
        fieldLabel: '描述信息',
        allowBlank: false,
        labelWidth: 70,
        xtype: 'textareafield',
        height: '65%',
        itemId: 'testDesignDetailFormDescription',
        cls: 'x-form-valid',
        readOnly: true
    }]
});

//用于显示测试计划审核结果的表单
var testDesignCheckResultForm = Ext.create("Ext.form.Panel", {
    border: false,
    defaults: {
        anchor: '98%',
        msgTarget: 'side',
        allowBlank: false,
        margin: '20 0 0 0'
    },
    bodyPadding: '10 20',
    items: [{
        margin: '0 0 0 0',
        fieldLabel: '审核结果',
        xtype: 'radiogroup',
        columns: [100, 100],
        itemId: 'testCheckFormIsPass',
        items: [{boxLabel: '通过', name: 'isPass', inputValue: 1, itemId: 'yes'}, {
            boxLabel: '不通过',
            checked: true,
            name: 'isPass',
            inputValue: 0,
            itemId: 'no'
        }]
    }, {
        xtype: 'displayfield',
        labelWidth: 115,
        fieldLabel: '审核时间',
        itemId: 'testCheckFormCheckDate'
    }, {
        xtype: 'textareafield',
        fieldLabel: '批注',
        height: '75%',
        labelWidth: 35,
        allowBlank: false,
        itemId: 'testCheckFormAnnotate'
    }]
});


//用于显示测试执行审核结果的表单
var testRunCheckResultForm = Ext.create("Ext.form.Panel", {
    defaults: {
        anchor: '98%',
        msgTarget: 'side',
        allowBlank: false,
        margin: '20 0 0 0'
    },
    bodyPadding: '10 20',
    items: [{
        margin: '0 0 0 0',
        fieldLabel: '审核结果',
        xtype: 'radiogroup',
        columns: [100, 100],
        itemId: 'testCheckFormIsPass',
        items: [{boxLabel: '通过', name: 'isPass', inputValue: 1, itemId: 'yes'}, {
            boxLabel: '不通过',
            checked: true,
            name: 'isPass',
            inputValue: 0,
            itemId: 'no'
        }]
    }, {
        xtype: 'displayfield',
        labelWidth: 115,
        fieldLabel: '审核时间',
        itemId: 'testCheckFormCheckDate'
    }, {
        xtype: 'textareafield',
        fieldLabel: '批注',
        height: '75%',
        labelWidth: 35,
        allowBlank: false,
        itemId: 'testCheckFormAnnotate'
    }]
});

//审核时用于查看测试执行详细信息的表单
var testRunCheckDetailForm = Ext.create("Ext.form.Panel", {
    id: 'testRunCheckDetailForm',
    header: false,
    bodyPadding: 10,
    border: false,
    defaults: {
        anchor: '100%',
        layout: 'column', //默认定义组件内部元素为布局为列布局方式
        border: false,
        margin: '20 0 0 0'
    },
    items: [{
        margin: '0 0 0 0',
        defaults: {
            border: false,
            layout: 'form',
        },
        items: [{
            columnWidth: 1, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'textfield',
                labelWidth: 50,
                allowBlank: false,
                fieldLabel: '标题',
                name: 'title',
                itemId: 'testRunDetailFormTitle',
                readOnly: true
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form'
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                labelWidth: 50,
                fieldLabel: '编写者',
                itemId: 'testRunDetailFormAuthor'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'combo',
                fieldLabel: '优先级',
                allowBlank: false,
                labelWidth: 50,
                editable: false,//防止用户直接在下拉框里输入
                itemId: 'testRunDetailFormPriority',
                emptyText: '选择计划优先级',
                store: priorityStore,
                queryMode: 'local',
                displayField: 'priorityName',
                valueField: 'priorityNum',
                readOnly: true
            }]
        }]
    }, {
        defaults: {
            border: false,
            layout: 'form'
        },
        items: [{
            columnWidth: .5, //该列占用的宽度，标识为50％
            items: [{
                xtype: 'displayfield',
                fieldLabel: '创建时间:',
                labelWidth: 70,
                itemId: 'testRunDetailFormCreateDate'
            }]
        }, {
            columnWidth: .5,
            items: [{
                xtype: 'displayfield',
                fieldLabel: '最近更新:',
                labelWidth: 70,
                itemId: 'testRunDetailFormUpdateDate'
            }]
        }]
    }, {
        xtype: 'displayfield',
        fieldLabel: '执行计划:',
        margin: '20 0 0 5',
        labelWidth: 70,
        itemId: 'testRunDetailFormTestDesign'
    }, {
        fieldLabel: '描述信息',
        allowBlank: false,
        labelWidth: 70,
        xtype: 'textareafield',
        height: '55%',
        itemId: 'testRunDetailFormDescription',
        cls: 'x-form-valid',
        readOnly: true
    }]
});